#pragma once
#include "rtda/heap/class_member.h"
#include "classfile/class_file.hpp"

namespace jvm {
namespace heap {

class Field : public ClassMember {
private:
    uint32_t m_constValueIndex;
    uint32_t m_slotId;

public:
    Field(std::shared_ptr<Class> pClass, const std::shared_ptr<classfile::MemberInfo> pMemberInfo);
    static std::vector<std::shared_ptr<Field>> newFields(std::shared_ptr<Class> pClass, const std::vector<std::shared_ptr<classfile::MemberInfo>>& cfFields);
    
    void copyAttributes(const std::shared_ptr<classfile::MemberInfo> pMemberInfo);
    
    // Access flags
    bool isVolatile() const;
    bool isTransient() const;
    bool isEnum() const;
    
    // Field properties
    uint32_t getConstValueIndex() const;
    uint32_t getSlotId() const;
    bool isLongOrDouble() const;
    
    // Setters
    void setSlotId(uint32_t slotId);
};

} // namespace heap
} // namespace jvm
